package com.times.microservice.controller;

import com.times.microservice.entity.Item;
import com.times.microservice.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version V1.0.0
 * @Title: 控制层，对外提供接口数据
 * @Package com.times.microservice.controller
 * @Description: ${TODO}
 * @author: TimesPanda
 * @date: 2020-04-05 15:33
 * @Copyright: 2020-04 Inc. All rights reserved.
 * 注意：本内容仅限于公司内部传阅，禁止外泄以及用于其他的商业目
 */
@RestController
public class ItemController {
    @Autowired
    private ItemService itemService;

    /**
     * 对外提供接口服务，查询商品信息
     *
     * @param id
     * @return
     */
    @GetMapping(value = "item/{id}")
    public Item queryItemById(@PathVariable("id") Long id) {
        return this.itemService.queryItemById(id);
    }
}
